<?php
/**
 * Created by PhpStorm.
 * User: liangtiehui
 * Date: 2016/5/4
 * Time: 18:09
 */

namespace Meidator;

include_once 'Mediator.php';
include_once 'ConcreteMediator.php';
include_once 'Human.php';
include_once 'Boss.php';
include_once 'Orchardist.php';

class Client
{
    public static function run()
    {
        $mediator = new ConcreteMediator();
        $orchardist = new Orchardist($mediator);
        $boss = new Boss($mediator);
        $mediator->setOrchardist($orchardist);
        $mediator->setBoss($boss);

        $orchardist->buy(ConcreteMediator::FRUIT, 50);
        $boss->buy(ConcreteMediator::FERTILIZER, 200);
    }
}

Client::run();